<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright   Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/**
 * Administrator account installation
 *
 * @see \Magento\Install\Block\Admin
 */
?>
<div class="page-head">
    <h3><?php echo __('Create Admin Account') ?></h3>
</div>
<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
<form action="<?php echo $this->getPostUrl() ?>" method="post" id="form-validate">
    <fieldset class="group-select wide">
        <legend><?php echo __('Personal Information') ?></legend>
        <h4 class="legend"><?php echo __('Personal Information') ?></h4>
        <ul>
            <li>
                <div class="input-box">
                    <label for="firstname"><?php echo __('First Name') ?> <span class="required">*</span></label><br/>
                    <input type="text" name="admin[firstname]" id="firstname"
                           value="<?php echo $this->getFormData()->getFirstname() ?>"
                           title="<?php echo __('First Name') ?>" data-validate="{required:true}"
                           class="input-text"/>
                </div>
                <div class="input-box">
                    <label for="lastname"><?php echo __('Last Name') ?> <span
                        class="required">*</span></label><br/>
                    <input type="text" name="admin[lastname]" id="lastname"
                           value="<?php echo $this->getFormData()->getLastname() ?>"
                           title="<?php echo __('Last Name') ?>" data-validate="{required:true}"
                           class="input-text"/>
                </div>
            </li>
            <li>
                <label for="email_address"><?php echo __('Email') ?> <span class="required">*</span></label><br/>
                <input type="text" name="admin[email]" id="email_address"
                       value="<?php echo $this->getFormData()->getEmail() ?>"
                       title="<?php echo __('Email Address') ?>"
                       data-validate="{required:true,'validate-email':true}" class="input-text"/>
            </li>
        </ul>
    </fieldset>
    <fieldset class="group-select wide">
        <legend><?php echo __('Login Information') ?></legend>
        <h4 class="legend"><?php echo __('Login Information') ?></h4>
        <ul>
            <li>
                <label for="username"><?php echo __('Username') ?> <span class="required">*</span></label><br/>
                <input type="text" name="admin[username]" id="username"
                       value="<?php echo $this->getFormData()->getUsername() ?>"
                       title="<?php echo __('Username') ?>" data-validate="{required:true}" class="input-text"/>
            </li>
            <li>
                <div class="input-box">
                    <label for="password"><?php echo __('Password') ?> <span
                        class="required">*</span></label><br/>
                    <input type="password" name="admin[password]" id="password"
                           title="<?php echo __('Password') ?>"
                           data-validate="{required:true,'validate-admin-password':true}" class="input-text"/>
                </div>
                <div class="input-box">
                    <label for="confirmation"><?php echo __('Confirm Password') ?> <span
                        class="required">*</span></label><br/>
                    <input type="password" name="admin[password_confirmation]"
                           title="<?php echo __('Password Confirmation') ?>" id="confirmation"
                           data-validate="{required:true, equalTo:'#password'}" class="input-text"/>
                </div>
            </li>
        </ul>
    </fieldset>
    <fieldset class="group-select wide">
        <legend><?php echo __('Encryption Key') ?></legend>
        <h4 class="legend"><?php echo __('Encryption Key') ?></h4>
        <ul>
            <li>
                <input type="text" name="encryption_key" id="encryption_key"
                       value="<?php echo $this->getFormData()->getEncryptionKey() ?>"
                       title="<?php echo __('Encryption Key') ?>" class="input-text"/>

                <p style="margin-top:4px; line-height:1.3em; color:#666;">
                    <small><?php echo __('Magento uses this key to encrypt passwords, credit cards and more. If you don\'t fill in this field, we\'ll create your encryption key and show it to you on the next page.') ?></small>
                </p>
            </li>
        </ul>
    </fieldset>
    <div class="button-set">
        <p class="required">* <?php echo __('Required Fields') ?></p>
        <button class="form-button" type="submit"><span><?php echo __('Continue') ?></span></button>
    </div>
</form>
<script type="text/javascript">
require([
    'jquery',
    "Magento_Install/js/install"
], function($){

    $.mage.install.createAdmin('#form-validate');

});
</script>
